home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / New System Software Extensions / QuickDraw™ 3D 1.0 / Development / Interfaces / QD3DGroup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-02  |  8.3 KB  |  269 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **                                                                             **
  4.  **     Module:        QD3DGroup.h                                                 **
  5.  **                                                                             **
  6.  **                                                                             **
  7.  **     Purpose:                                                             **
  8.  **                                                                             **
  9.  **                                                                             **
  10.  **     Copyright (C) 1992-1995 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                             **
  12.  **                                                                             **
  13.  *****************************************************************************/
  14. #ifndef QD3DGroup_h
  15. #define QD3DGroup_h
  16.  
  17. #ifndef QD3D_h
  18. #include "QD3D.h"
  19. #endif  /*  QD3D_h  */
  20.  
  21. #if PRAGMA_ONCE
  22.     #pragma once
  23. #endif
  24.  
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif /*  __cplusplus  */
  29.  
  30.  
  31. /******************************************************************************
  32.  **                                                                             **
  33.  **                            Group Typedefs                                     **
  34.  **                                                                             **
  35.  *****************************************************************************/
  36.  
  37. /*
  38.  * These flags affect how a group is traversed
  39.  * They apply to when a group is "drawn", "picked", "bounded", "written"
  40.  */
  41. typedef enum TQ3DisplayGroupStateMasks {
  42.     kQ3DisplayGroupStateNone                    = 0,
  43.     kQ3DisplayGroupStateMaskIsDrawn                = 1 << 0,
  44.     kQ3DisplayGroupStateMaskIsInline            = 1 << 1,
  45.     kQ3DisplayGroupStateMaskUseBoundingBox        = 1 << 2,
  46.     kQ3DisplayGroupStateMaskUseBoundingSphere    = 1 << 3,
  47.     kQ3DisplayGroupStateMaskIsPicked            = 1 << 4,
  48.     kQ3DisplayGroupStateMaskIsWritten            = 1 << 5
  49. } TQ3DisplayGroupStateMasks;
  50.  
  51. typedef unsigned long TQ3DisplayGroupState;
  52.  
  53. /******************************************************************************
  54.  **                                                                             **
  55.  **                    Group Routines (apply to all groups)                     **
  56.  **                                                                             **
  57.  *****************************************************************************/
  58.  
  59. QD3D_EXPORT TQ3GroupObject Q3Group_New(        /* May contain any shared object */
  60.     void);
  61.     
  62. QD3D_EXPORT TQ3ObjectType Q3Group_GetType(
  63.     TQ3GroupObject            group);
  64.  
  65. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObject(
  66.     TQ3GroupObject            group,
  67.     TQ3Object                object);
  68.     
  69. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObjectBefore(
  70.     TQ3GroupObject            group,
  71.     TQ3GroupPosition        position,
  72.     TQ3Object                object);
  73.  
  74. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObjectAfter(
  75.     TQ3GroupObject            group,
  76.     TQ3GroupPosition        position,
  77.     TQ3Object                object);
  78.  
  79. QD3D_EXPORT TQ3Status Q3Group_GetPositionObject(
  80.     TQ3GroupObject            group,
  81.     TQ3GroupPosition        position,    
  82.     TQ3Object                *object);        
  83.  
  84. QD3D_EXPORT TQ3Status Q3Group_SetPositionObject(
  85.     TQ3GroupObject            group,
  86.     TQ3GroupPosition        position,
  87.     TQ3Object                object);
  88.  
  89. QD3D_EXPORT TQ3Object Q3Group_RemovePosition(
  90.     TQ3GroupObject            group,
  91.     TQ3GroupPosition        position);
  92.  
  93. QD3D_EXPORT TQ3Status Q3Group_GetFirstPosition(        
  94.     TQ3GroupObject            group,
  95.     TQ3GroupPosition        *position);
  96.  
  97. QD3D_EXPORT TQ3Status Q3Group_GetLastPosition(        
  98.     TQ3GroupObject            group,
  99.     TQ3GroupPosition        *position);
  100.  
  101. QD3D_EXPORT TQ3Status Q3Group_GetNextPosition(        
  102.     TQ3GroupObject            group,
  103.     TQ3GroupPosition        *position);
  104.  
  105. QD3D_EXPORT TQ3Status Q3Group_GetPreviousPosition(        
  106.     TQ3GroupObject            group,
  107.     TQ3GroupPosition        *position);
  108.  
  109. QD3D_EXPORT TQ3Status Q3Group_CountObjects(
  110.     TQ3GroupObject            group,
  111.     unsigned long            *nObjects);
  112.  
  113. QD3D_EXPORT TQ3Status Q3Group_EmptyObjects(
  114.     TQ3GroupObject            group);
  115.     
  116. /*
  117.  *     Typed Access
  118.  */
  119. QD3D_EXPORT TQ3Status Q3Group_GetFirstPositionOfType(        
  120.     TQ3GroupObject            group,
  121.     TQ3ObjectType            isType,
  122.     TQ3GroupPosition        *position);
  123.  
  124. QD3D_EXPORT TQ3Status Q3Group_GetLastPositionOfType(        
  125.     TQ3GroupObject            group,
  126.     TQ3ObjectType            isType,
  127.     TQ3GroupPosition        *position);
  128.  
  129. QD3D_EXPORT TQ3Status Q3Group_GetNextPositionOfType(        
  130.     TQ3GroupObject            group,
  131.     TQ3ObjectType            isType,
  132.     TQ3GroupPosition        *position);
  133.  
  134. QD3D_EXPORT TQ3Status Q3Group_GetPreviousPositionOfType(        
  135.     TQ3GroupObject            group,
  136.     TQ3ObjectType            isType,
  137.     TQ3GroupPosition        *position);
  138.  
  139. QD3D_EXPORT TQ3Status Q3Group_CountObjectsOfType(
  140.     TQ3GroupObject            group,
  141.     TQ3ObjectType            isType,
  142.     unsigned long            *nObjects);
  143.  
  144. QD3D_EXPORT TQ3Status Q3Group_EmptyObjectsOfType(
  145.     TQ3GroupObject            group,
  146.     TQ3ObjectType            isType);
  147.  
  148. /*
  149.  *    Determine position of objects in a group
  150.  */
  151. QD3D_EXPORT TQ3Status Q3Group_GetFirstObjectPosition(
  152.     TQ3GroupObject            group,
  153.     TQ3Object                object,
  154.     TQ3GroupPosition        *position);
  155.     
  156. QD3D_EXPORT TQ3Status Q3Group_GetLastObjectPosition(
  157.     TQ3GroupObject            group,
  158.     TQ3Object                object,
  159.     TQ3GroupPosition        *position);
  160.  
  161. QD3D_EXPORT TQ3Status Q3Group_GetNextObjectPosition(
  162.     TQ3GroupObject            group,
  163.     TQ3Object                object,
  164.     TQ3GroupPosition        *position);
  165.     
  166. QD3D_EXPORT TQ3Status Q3Group_GetPreviousObjectPosition(
  167.     TQ3GroupObject            group,
  168.     TQ3Object                object,
  169.     TQ3GroupPosition        *position);
  170.     
  171.  
  172. /******************************************************************************
  173.  **                                                                             **
  174.  **                            Group Subclasses                                 **
  175.  **                                                                             **
  176.  *****************************************************************************/
  177.  
  178. QD3D_EXPORT TQ3GroupObject Q3LightGroup_New(    /* Must contain only lights */
  179.     void);
  180.  
  181. QD3D_EXPORT TQ3GroupObject Q3InfoGroup_New(        /* Must contain only strings */
  182.     void);
  183.  
  184. /******************************************************************************
  185.  **                                                                             **
  186.  **                        Display Group Routines                                 **
  187.  **                                                                             **
  188.  *****************************************************************************/
  189.  
  190. QD3D_EXPORT TQ3GroupObject Q3DisplayGroup_New(    /* May contain only drawables */
  191.     void);
  192.     
  193. QD3D_EXPORT TQ3ObjectType Q3DisplayGroup_GetType(
  194.     TQ3GroupObject            group);
  195.  
  196. QD3D_EXPORT TQ3Status Q3DisplayGroup_GetState(
  197.     TQ3GroupObject            group,
  198.     TQ3DisplayGroupState    *state);
  199.     
  200. QD3D_EXPORT TQ3Status Q3DisplayGroup_SetState(
  201.     TQ3GroupObject            group,
  202.     TQ3DisplayGroupState    state);
  203.  
  204. QD3D_EXPORT TQ3Status Q3DisplayGroup_Submit(
  205.     TQ3GroupObject            group, 
  206.     TQ3ViewObject            view);
  207.  
  208. /******************************************************************************
  209.  **                                                                             **
  210.  **        Ordered Display Group                                                  **
  211.  **                                                                             **
  212.  **        Ordered display groups keep objects in order by the type of object:     **
  213.  **                                                                             **
  214.  **        1    kQ3ShapeTypeTransform                                             **
  215.  **        2    kQ3ShapeTypeStyle                                                  **
  216.  **        3    kQ3SetTypeAttribute                                                  **
  217.  **        4    kQ3ShapeTypeShader                                                  **
  218.  **        5    kQ3ShapeTypeCamera                                                  **
  219.  **        6    kQ3ShapeTypeLight                                                  **
  220.  **        7    kQ3ShapeTypeGeometry                                             **
  221.  **        8    kQ3ShapeTypeGroup                                                 **            
  222.  **        9    kQ3ShapeTypeUnknown                                                 **
  223.  **                                                                             **
  224.  **        Within a type, you are responsible for keeping things in order.         **
  225.  **                                                                             **
  226.  **        You may access and/or manipulate the group using the above types      **
  227.  **        (fast), or you may use any parent or leaf class types (slower).         **
  228.  **                                                                             **
  229.  **        Additional types will be added as functionality grows.                 **
  230.  **                                                                             **
  231.  **        The group calls which access by type are much faster for ordered     ** 
  232.  **        display group for the types above.                                     **
  233.  **                                                                             **
  234.  **        N.B. In QuickDraw 3D 1.0 Lights and Cameras are a no-op when drawn.     **
  235.  **                                                                             **
  236.  *****************************************************************************/
  237.  
  238. QD3D_EXPORT TQ3GroupObject Q3OrderedDisplayGroup_New(
  239.     void);
  240.  
  241. /******************************************************************************
  242.  **                                                                             **
  243.  **        IO Proxy Display Group                                                  **
  244.  **                                                                             **
  245.  **        IO Proxy display groups are used to place more than one              **
  246.  **        representation of an object in a metafile. For example, if you know     **
  247.  **        another program does not understand NURBPatches but does understand  **
  248.  **        Meshes, you may place a mesh and a NURB Patch in an IO Proxy Group,  **
  249.  **        and the reading program will select the desired representation.         **
  250.  **                                                                             **
  251.  **        Objects in an IO Proxy Display Group are placed in their preferencial**
  252.  **        order, with the FIRST object being the MOST preferred, the LAST      **
  253.  **        object the least preferred.                                             **
  254.  **                                                                             **
  255.  **        The behavior of an IO Proxy Display Group is that when drawn/picked/ **
  256.  **        bounded, the first object in the group that is not "Unknown" is used,**
  257.  **        and the other objects ignored.                                         **
  258.  **                                                                             **
  259.  *****************************************************************************/
  260.  
  261. QD3D_EXPORT TQ3GroupObject Q3IOProxyDisplayGroup_New(
  262.     void);
  263.         
  264. #ifdef __cplusplus
  265. }
  266. #endif /*  __cplusplus  */
  267.  
  268. #endif /*  QD3DGroup_h  */
  269.